/**
 * Created by Administrator on 2017/3/4.
 */
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import { Jsonp, URLSearchParams,Response,Http, Headers, RequestOptions } from '@angular/http';
import { Observable }   from 'rxjs/observable';
import 'rxjs/add/operator/catch';

@Injectable()
export class reseditService {
  constructor(
    private http:Http,
    private jsonp:Jsonp
  ) {}
  public statu='';
  private showfrom:boolean;
  pic (email:string) {
    let wikiUrl = 'http://api.pinwu.net/upload/upload';
    let params = new URLSearchParams();
    params.append('email', email);
    return this.http
            .get(wikiUrl, { search: params })
             .map((res:Response)=>{
             let result=res.json();
             console.log(result);
             return result;
     });
  }
   getmateril(){
     let materilist = 'http://api.pinwu.net/site/tree1';
     let params = new URLSearchParams();
     params.set('callback', 'JSONP_CALLBACK');
     return this.jsonp
       .get(materilist, { search: params })
       .map((res:Response)=>{
         let result=res.json();
         console.log(result);
         return result;
       });
   }
}
